<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <ul>
            <li v-for="student in students" @click="show(student,$event)" :title="student.name" :key="student.id">
                {{student.id}}.{{ student.name }}-{{ student.age }}-{{ student.gender }}
            </li>
        </ul>
    </div>
    <!-- <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> -->
    <script src="../assets/vue3.js"></script>
    <script>
        const app = Vue.createApp({
            data() {
                return {
                    students: [
                        { id: 1, name: '张三', age: 22, gender: '男' },
                        { id: 2, name: '李四', age: 29, gender: '女' },
                        { id: 3, name: '王二', age: 32, gender: '男' }
                    ]
                }
            },
            methods: {
                show(student, event) {
                    console.log(student.id, student.name, student.age, student.gender);
                    console.log(event.target.title);
                }
            },
        });
        app.mount('#app');
    </script>
</body>

</html>